﻿@model IEnumerable<VacationsRequest.Models.ApprovalList>
@{
    ViewBag.Title = "Approvals";
}
<h2>
    Approve Vacations</h2>
    <p>
    @using (Html.BeginForm("Index", "ApprovalStatus", FormMethod.Get))
    {   
        <p>
            Pending: @Html.CheckBox("_pending", true) | 
            Accepted: @Html.CheckBox("_accepted", false) | 
            Rejected: @Html.CheckBox("_rejected", false)
            <input type="submit" value="Filter" /></p>
    }
    </p>
<table>
    <tr>
        <th>
            Employee Name
        </th>
        <th>
            Date Created
        </th>
        <th>
            From Date
        </th>
        <th>
            To Date
        </th>
        <th>
            Status
        </th>
        <th>
            Days Reserved
        </th>
        <th>
            Notified
        </th>
        <th>
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td style="text-align: right; padding-right: 5px;">
                @Html.DisplayFor(modelItem => item.EmployeeName)
            </td>
            <td style="text-align: right; padding-right: 5px;">
                @Html.DisplayFor(modelItem => item.DateCreated)
            </td>
            <td style="text-align: right; padding-right: 5px;">
                @Html.DisplayFor(modelItem => item.FromDate)
            </td>
            <td style="text-align: right; padding-right: 5px;">
                @Html.DisplayFor(modelItem => item.ToDate)
            </td>
            <td style="text-align: right; padding-right: 5px;">
                @Html.DisplayFor(modelItem => item.Status)
            </td>
            <td style="text-align: right; padding-right: 5px;">
                @Html.DisplayFor(modelItem => item.NumDays)
            </td>
            <td style="text-align: center;">
                @Html.DisplayFor(modelItem => item.Notified)
            </td>
            <td>
                @if (item.IdStatus == 1)
                {
                    @Html.ActionLink("Approve/Reject", "Edit", new { id = item.ID }) @Html.Raw(" | ")
                }
                @Html.ActionLink("Details", "Details", new { id = item.ID }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.ID }, new { onclick = "return confirm('Are you sure you wish to delete this approval request?');" })
            </td>
        </tr>
    }
</table>
